﻿using Core.Domain.Entities;
using FluentNHibernate.Mapping;

namespace DataMain.Mappings
{
  public class PersonMap : ClassMap<Person>
  {
    public PersonMap()
    {
      Id(x => x.Id);
      Map(x => x.FirstName).WithLengthOf(50).Not.Nullable();
      Map(x => x.LastName).WithLengthOf(50).Not.Nullable();
      Map(x => x.BahaiId).WithLengthOf(15);
      Map(x => x.OtherFirstNames).WithLengthOf(250);
      Map(x => x.OtherLastNames).WithLengthOf(250);
      Map(x => x.BirthDate);
      Map(x => x.AgeGroup);
      Map(x => x.AdminRightsRemoved);
      References(x => x.Community); 
    }
  }
}